#ifndef _K_FUNCTIONAL_
#define _K_FUNCTIONAL_

template<typename ReturnType, typename Param1Type, typename Param2Type>
class TwoParamFunction
{
public:
	virtual ReturnType operator()(Param1Type param1, Param2Type param2)=0;
};

template<typename Class, typename ReturnType, typename Param1Type, typename Param2Type>
class TwoParamClassFunction: public TwoParamFunction<ReturnType, Param1Type, Param2Type>
{
public:
	typedef ReturnType (Class::*MethodPrototype)(Param1Type, Param2Type);
	TwoParamClassFunction(Class& obj, MethodPrototype meth):m_obj(obj), m_meth(meth){}
	virtual ReturnType operator()(Param1Type param1, Param2Type param2)
	{
		return (m_obj.*m_meth)(param1, param2);
	}
private:
	Class &m_obj;
	MethodPrototype m_meth;
};

#endif	//_K_FUNCTIONAL_